/*
 * @Author: huang liang miao 1127255342@qq.com
 * @Date: 2024-11-18 10:36:47
 * @LastEditors: huang liang miao 1127255342@qq.com
 * @LastEditTime: 2024-11-20 15:19:03
 * @FilePath: \dcy-webd:\webCode\dcyCode\scientific_research_manager_web\src\api\system\menu.ts
 * @Description: 菜单管理
 */
import request from '@/utils/request'
import {
  MenuListQuery,
  MenuListVO,
  MenuCreateReqDTO,
  MenuPermissionPointListVO,
} from './type'


// 查询菜单列表
export function menuListReq(data?:MenuListQuery) {
  return request<MenuListVO[]>({
    url: '/resource/api/menu/list',
    method: 'post',
    data: data || {}
  })
}
// 菜单创建
export function createMenuReq(data?:MenuCreateReqDTO) {
  return request({
    url: '/resource/api/menu/create',
    method: 'post',
    data: data
  })
}

// 查询菜单编辑
export function updateListReq(data?:MenuListQuery) {
  return request<MenuListVO[]>({
    url: '/resource/api/menu/update',
    method: 'post',
    data: data
  })
}

// 菜单删除
export function deleteListReq(data?: {id: string}) {
  return request({
    url: '/resource/api/menu/delete',
    method: 'post',
    data: data
  })
}

// 查询菜单权限点
export function menuPermissionPointListReq(data?:{id: string}) {
  return request<MenuPermissionPointListVO>({
    url: '/resource/api/menu/menuPermissionPointList',
    method: 'post',
    data: data
  })
}

